﻿using OpenCvSharp;
using System.Diagnostics;
using System.Drawing;

namespace SSIM
{
    internal class Program
    {
        private const double C1 = (0.01 * 255) * (0.01 * 255);
        private const double C2 = (0.03 * 255) * (0.03 * 255);

        static void Main(string[] args)
        {
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            var path1 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "test5.png");
            var path2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "test6.png");

            //SSIMCalculator2 sSIMCalculator2 = new SSIMCalculator2();
            //double num = sSIMCalculator2.CalculateSSIM(path1, path2);

            using Bitmap img1 = new Bitmap(path1);
            using Bitmap img2 = new Bitmap(path2);

            SSIMCalculator sSIMCalculator = new SSIMCalculator();
            double ssim = sSIMCalculator.CalculateSSIM(img1, img2);
            stopwatch.Stop();
            Console.WriteLine(stopwatch.ElapsedMilliseconds);
            Console.WriteLine(ssim);
            Console.ReadKey();
        }

    }
}
